<!-- saved from url=(0014)about:internet -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>SuperTextInput.as</title>
<link rel="stylesheet" type="text/css" href="../../../../SourceStyles.css"/>
</head>

<body><pre><span class="ActionScriptComment">/* Copyright (c) 2008 bvproject - Gilles Guillemin  See:
    http://code.google.com/p/bvproject/

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the &quot;Software&quot;), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. */</span>

<span class="ActionScriptpackage">package</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">bvproject</span>.<span class="ActionScriptDefault_Text">controls</span>
<span class="ActionScriptBracket/Brace">{</span>
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">chewtinfoil</span>.<span class="ActionScriptDefault_Text">utils</span>.<span class="ActionScriptDefault_Text">StringUtils</span>;

<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span>.<span class="ActionScriptDefault_Text">events</span>.<span class="ActionScriptDefault_Text">Event</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span>.<span class="ActionScriptDefault_Text">events</span>.<span class="ActionScriptDefault_Text">FocusEvent</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span>.<span class="ActionScriptDefault_Text">events</span>.<span class="ActionScriptDefault_Text">KeyboardEvent</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span>.<span class="ActionScriptDefault_Text">events</span>.<span class="ActionScriptDefault_Text">MouseEvent</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span>.<span class="ActionScriptDefault_Text">ui</span>.<span class="ActionScriptDefault_Text">Keyboard</span>;

<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">controls</span>.<span class="ActionScriptDefault_Text">TextInput</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">controls</span>.<span class="ActionScriptDefault_Text">TextArea</span>;
<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">flash</span>.<span class="ActionScriptDefault_Text">text</span>.<span class="ActionScriptDefault_Text">TextLineMetrics</span>;

<span class="ActionScriptComment">//--------------------------------------
</span><span class="ActionScriptComment">//  Styles
</span><span class="ActionScriptComment">//--------------------------------------
</span>
<span class="ActionScriptASDoc">/**
 *  Color of the prompt when activated
 *
 *  @default 0xAAAAAA
 */</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Style</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;promptColor&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;String&quot;</span>, <span class="ActionScriptDefault_Text">format</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Color&quot;</span>, <span class="ActionScriptDefault_Text">inherit</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;no&quot;</span><span class="ActionScriptBracket/Brace">)]</span>
<span class="ActionScriptASDoc">/**
 *  Style of the prompt when activated
 *
 *  @default italic
 */</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Style</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;promptStyle&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;String&quot;</span>, <span class="ActionScriptDefault_Text">enumeration</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;normal,italic&quot;</span>, <span class="ActionScriptDefault_Text">inherit</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;no&quot;</span><span class="ActionScriptBracket/Brace">)]</span>
<span class="ActionScriptASDoc">/**
 *  Weight of the prompt when activated
 *
 *  @default normal
 */</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Style</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;promptWeight&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;String&quot;</span>, <span class="ActionScriptDefault_Text">enumeration</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;normal,bold&quot;</span>, <span class="ActionScriptDefault_Text">inherit</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;no&quot;</span><span class="ActionScriptBracket/Brace">)]</span>
<span class="ActionScriptASDoc">/**
 *  Color of the required indicator when activated
 *
 *  @default 0xFF0000
 */</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Style</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">name</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;requiredColor&quot;</span>, <span class="ActionScriptDefault_Text">type</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;String&quot;</span>, <span class="ActionScriptDefault_Text">format</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;Color&quot;</span>, <span class="ActionScriptDefault_Text">inherit</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;no&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

<span class="ActionScriptComment">//--------------------------------------
</span><span class="ActionScriptComment">//  Other metadata
</span><span class="ActionScriptComment">//--------------------------------------
</span>
<span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">IconFile</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;../assets/SuperTextInput.png&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

<span class="ActionScriptASDoc">/**
 *  The SuperTextInput control is an enhanced
 *  TextInput control including several missing functionalities
 *     like a prompt function, a required indicator, etc
 *     SuperTextInput extends TextArea control and not
 *     TextInput and thus inherits TextArea properties
 *     like wordWrap for example.
 *  @mxml
 *
 *
 *  &lt;p&gt;The &lt;code&gt;&amp;lt;fc:SuperTextInput&amp;gt;&lt;/code&gt; tag inherits all the tag attributes
 *  of its superclass, and adds the following tag attributes:&lt;/p&gt;
 *
 *  &lt;pre&gt;
 *  &amp;lt;fc:SuperTextInput
 *    &lt;b&gt;Properties&lt;/b&gt;
 *       prompt=&quot;&lt;i&gt;No default&lt;/i&gt;&quot;
 *       clearPromptOnFocus=&quot;false&quot;
 *       required=&quot;false&quot;
 *       startUpperCase=&quot;false&quot;
 *       variableWidth=&quot;false&quot;
 *
 *       &lt;b&gt;Styles&lt;/b&gt;
 *    promptColor=&quot;0xAAAAAA&quot;
 *    promptStyle=&quot;italic&quot;
 *    promptWeight=&quot;bold&quot;
 *    requiredColor=&quot;0xFF0000&quot;
 *    &amp;nbsp;
 *  /&amp;gt;
 *  &lt;/pre&gt;
 *
 *  @includeExample ../../../../../../docs/com/adobe/flex/extras/controls/example/AutoCompleteCountriesData/AutoCompleteCountriesData.mxml
 *
 *  @see mx.controls.TextArea
 *
 */</span>

<span class="ActionScriptReserved">public</span> <span class="ActionScriptclass">class</span> <span class="ActionScriptDefault_Text">SuperTextInput</span> <span class="ActionScriptReserved">extends</span> <span class="ActionScriptDefault_Text">TextArea</span>
<span class="ActionScriptBracket/Brace">{</span>
    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//  Constructor
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  Constructor.
     */</span>

    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">SuperTextInput</span><span class="ActionScriptBracket/Brace">()</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">super</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">Event</span>.<span class="ActionScriptDefault_Text">CHANGE</span>, <span class="ActionScriptDefault_Text">handleTextChange</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">FocusEvent</span>.<span class="ActionScriptDefault_Text">FOCUS_IN</span>, <span class="ActionScriptDefault_Text">handleFocusIn</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">FocusEvent</span>.<span class="ActionScriptDefault_Text">FOCUS_OUT</span>, <span class="ActionScriptDefault_Text">handleFocusOut</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">MouseEvent</span>.<span class="ActionScriptDefault_Text">CLICK</span>,<span class="ActionScriptDefault_Text">reposition</span>,<span class="ActionScriptReserved">true</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;borderStyle&quot;</span>, <span class="ActionScriptString">&quot;inset&quot;</span><span class="ActionScriptBracket/Brace">)</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//  Variables
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  Current version of the component version: 0.9.0.0
     */</span>
    <span class="ActionScriptReserved">public</span> <span class="ActionScriptReserved">static</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">version</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;0.9.0.0&quot;</span>;

    <span class="ActionScriptASDoc">/**
     *  @private
     *  Default values for the component specific styles.
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_promptColor</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;#AAAAAA&quot;</span>;
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_promptStyle</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;italic&quot;</span>;
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_promptWeight</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">String</span>;
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_requiredColor</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;#FF0000&quot;</span>;

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptReserved">static</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">hexChars</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;0123456789ABCDEF&quot;</span>;
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_delete</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">Boolean</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;

    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//  Overridden properties
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>
    <span class="ActionScriptComment">//----------------------------------
</span>    <span class="ActionScriptComment">//  displayAsPassword
</span>    <span class="ActionScriptComment">//----------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_displayAsPassword</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;

    <span class="ActionScriptASDoc">/**
     *  Indicates whether this control is used for entering passwords.
     *  If &lt;code&gt;true&lt;/code&gt;, the field does not display entered text,
     *  instead, each text character entered into the control
     *  appears as the  character &quot;&amp;#42;&quot;.
     *
     *  @default false
     *  @tiptext Specifies whether to display &apos;*&apos;
     *  instead of the actual characters
     *  @helpid 3197
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">set</span> <span class="ActionScriptDefault_Text">displayAsPassword</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span> <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptDefault_Text">_displayAsPassword</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">value</span>;
        <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">displayAsPassword</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">value</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">get</span> <span class="ActionScriptDefault_Text">displayAsPassword</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span> <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">_displayAsPassword</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptComment">//----------------------------------
</span>    <span class="ActionScriptComment">//  text
</span>    <span class="ActionScriptComment">//----------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  @private
     *  Storage for the text property.
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_text</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">String</span>;
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_textChanged</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">Boolean</span>;
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_showPrompt</span><span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">Boolean</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;

    <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Bindable</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;textChanged&quot;</span><span class="ActionScriptBracket/Brace">)]</span>
    <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">CollapseWhiteSpace</span><span class="ActionScriptBracket/Brace">]</span>
    <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">NonCommittingChangeEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;change&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

    <span class="ActionScriptASDoc">/**
     *  Plain text that appears in the control.
     *  Its appearance is determined by the CSS styles of this Label control.
     *
     *  &lt;p&gt;Any HTML tags in the text string are ignored,
     *  and appear as  entered in the string.
     *  To display text formatted using HTML tags,
     *  use the &lt;code&gt;htmlText&lt;/code&gt; property instead.
     *  If you set the &lt;code&gt;htmlText&lt;/code&gt; property,
     *  the HTML replaces any text you had set using this propety, and the
     *  &lt;code&gt;text&lt;/code&gt; property returns a plain-text version of the
     *  HTML text, with all HTML tags stripped out.
     *  For more information see the &lt;code&gt;htmlText&lt;/code&gt; property.&lt;/p&gt;
     *
     *  &lt;p&gt;To include the special characters left angle  bracket (&amp;lt;),
     *  right angle bracket (&amp;gt;), or ampersand (&amp;amp;) in the text,
     *  wrap the text string in the CDATA tag.
     *  Alternatively, you can use HTML character entities for the
     *  special characters, for example, &lt;code&gt;&amp;amp;lt;&lt;/code&gt;.&lt;/p&gt;
     *
     *  &lt;p&gt;If you try to set this property to &lt;code&gt;null&lt;/code&gt;,
     *  it is set, instead, to the empty string.
     *  The &lt;code&gt;text&lt;/code&gt; property can temporarily have the value &lt;code&gt;null&lt;/code&gt;,
     *  which indicates that the &lt;code&gt;htmlText&lt;/code&gt; has been recently set
     *  and the corresponding &lt;code&gt;text&lt;/code&gt; value
     *  has not yet been determined.&lt;/p&gt;
     *
     *  @default &quot;&quot;
     *  @tiptext Gets or sets the TextArea content
     *  @helpid 3179
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">get</span> <span class="ActionScriptDefault_Text">text</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_showPrompt</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">return</span> <span class="ActionScriptString">&quot;&quot;</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptReserved">return</span> <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">text</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">set</span> <span class="ActionScriptDefault_Text">text</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptDefault_Text">_text</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">value</span>;
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span> <span class="ActionScriptOperator">!=</span> <span class="ActionScriptString">&quot;&quot;</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">_showPrompt</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptReserved">else</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">_showPrompt</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptDefault_Text">invalidateProperties</span><span class="ActionScriptBracket/Brace">()</span>;

        <span class="ActionScriptDefault_Text">dispatchEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;textChanged&quot;</span><span class="ActionScriptBracket/Brace">))</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//  Properties
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>
    <span class="ActionScriptComment">//----------------------------------
</span>    <span class="ActionScriptComment">//  clearPromptOnFocus
</span>    <span class="ActionScriptComment">//----------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_clearPromptOnFocus</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_hasFocus</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">Boolean</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;

    <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Inspectable</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">category</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;General&quot;</span>, <span class="ActionScriptDefault_Text">defaultValue</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;false&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

    <span class="ActionScriptASDoc">/**
     *  If &lt;code&gt;true&lt;/code&gt;, automatically clears the prompt text
     *     (if activated) when the focus is set on the component
     *  If &lt;code&gt;false&lt;/code&gt;, the prompt text is cleared only when
     *     the user starts typing.
     *
     *  @default false
     */</span>
    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">get</span> <span class="ActionScriptDefault_Text">clearPromptOnFocus</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">_clearPromptOnFocus</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">set</span> <span class="ActionScriptDefault_Text">clearPromptOnFocus</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span> <span class="ActionScriptOperator">!=</span> <span class="ActionScriptDefault_Text">_clearPromptOnFocus</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">_clearPromptOnFocus</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">value</span>;

            <span class="ActionScriptDefault_Text">invalidateProperties</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptComment">//----------------------------------
</span>    <span class="ActionScriptComment">//  prompt
</span>    <span class="ActionScriptComment">//----------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  @private
     *  Storage for the prompt property.
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_prompt</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;&quot;</span>;

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">promptChanged</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_htmlPrompt</span><span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">String</span>;

    <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Inspectable</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">category</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;General&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

    <span class="ActionScriptASDoc">/**
     *  The prompt for the SuperTextInput control. A prompt is
     *  a String that is displayed in the SuperTextInput when
     *  no text is typed or no value is affected to text
     */</span>
    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">get</span> <span class="ActionScriptDefault_Text">prompt</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">_prompt</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">set</span> <span class="ActionScriptDefault_Text">prompt</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptDefault_Text">_prompt</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">value</span>;
        <span class="ActionScriptDefault_Text">promptChanged</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
<span class="ActionScriptComment">//        if (_prompt == &quot;&quot;)
</span><span class="ActionScriptComment">//            _showPrompt = false;
</span>        <span class="ActionScriptDefault_Text">invalidateProperties</span><span class="ActionScriptBracket/Brace">()</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptComment">//----------------------------------
</span>    <span class="ActionScriptComment">//  required
</span>    <span class="ActionScriptComment">//----------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_required</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_requiredChanged</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">Boolean</span>;

    <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Bindable</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;requiredChanged&quot;</span><span class="ActionScriptBracket/Brace">)]</span>
    <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Inspectable</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">category</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;General&quot;</span>, <span class="ActionScriptDefault_Text">defaultValue</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;false&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

    <span class="ActionScriptASDoc">/**
     *  If &lt;code&gt;true&lt;/code&gt;, displays an indicator
     *  that the SuperTextInput control requires user input.
     *  If &lt;code&gt;false&lt;/code&gt;, indicator is not displayed.
     *
     *  &lt;p&gt;This property controls the indicator display only.
     *  You must attach a validator to the SuperTextInput
     *  control if you require input validation.&lt;/p&gt;
     *
     *  @default false
     */</span>
    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">get</span> <span class="ActionScriptDefault_Text">required</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">_required</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">set</span> <span class="ActionScriptDefault_Text">required</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptDefault_Text">_required</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">value</span>;
        <span class="ActionScriptDefault_Text">_requiredChanged</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
        <span class="ActionScriptDefault_Text">invalidateProperties</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptDefault_Text">dispatchEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptReserved">new</span> <span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;requiredChanged&quot;</span><span class="ActionScriptBracket/Brace">))</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptComment">//----------------------------------
</span>    <span class="ActionScriptComment">//  startUpperCase
</span>    <span class="ActionScriptComment">//----------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_startUpperCase</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">Boolean</span>;
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_startUpperCaseChanged</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">Boolean</span>;

    <span class="ActionScriptASDoc">/**
     *  If &lt;code&gt;true&lt;/code&gt;, the first letter
     *     (if it&apos;s an alphabetic input) is automatically
     *     converted to uppercase.
     *     Particularly useful for user forms.
     *
     *  @default false
     */</span>
    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">get</span> <span class="ActionScriptDefault_Text">startUpperCase</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">_startUpperCase</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">set</span> <span class="ActionScriptDefault_Text">startUpperCase</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span> <span class="ActionScriptOperator">!=</span> <span class="ActionScriptDefault_Text">_startUpperCase</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">_startUpperCase</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">value</span>;
            <span class="ActionScriptDefault_Text">_startUpperCaseChanged</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;

            <span class="ActionScriptDefault_Text">invalidateProperties</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptComment">//----------------------------------
</span>    <span class="ActionScriptComment">//  variableWidth
</span>    <span class="ActionScriptComment">//----------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">_variableWidth</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;

    <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Inspectable</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">category</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;General&quot;</span>, <span class="ActionScriptDefault_Text">defaultValue</span><span class="ActionScriptOperator">=</span><span class="ActionScriptString">&quot;false&quot;</span><span class="ActionScriptBracket/Brace">)]</span>

    <span class="ActionScriptASDoc">/**
     *    (Experimental)
     *  If &lt;code&gt;true&lt;/code&gt;, the SuperTextInput control
     *  automatically expands if the entered text
     *     overrides the limits of the component.
     *
     *  @default false
     */</span>
    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">get</span> <span class="ActionScriptDefault_Text">variableWidth</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">_variableWidth</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptReserved">set</span> <span class="ActionScriptDefault_Text">variableWidth</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Boolean</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">value</span> <span class="ActionScriptOperator">!=</span> <span class="ActionScriptDefault_Text">_variableWidth</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">_variableWidth</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">value</span>;

            <span class="ActionScriptDefault_Text">invalidateProperties</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//  Overridden methods
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">commitProperties</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">promptChanged</span> <span class="ActionScriptOperator">||</span> <span class="ActionScriptDefault_Text">_requiredChanged</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">promptChanged</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
            <span class="ActionScriptDefault_Text">_requiredChanged</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
            <span class="ActionScriptDefault_Text">_htmlPrompt</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">_prompt</span>;
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_promptStyle</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptString">&quot;italic&quot;</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptDefault_Text">_htmlPrompt</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;&lt;i&gt;&quot;</span><span class="ActionScriptOperator">+</span><span class="ActionScriptDefault_Text">_htmlPrompt</span><span class="ActionScriptOperator">+</span><span class="ActionScriptString">&quot;&lt;/i&gt;&quot;</span>;

            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_promptStyle</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptString">&quot;bold&quot;</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptDefault_Text">_htmlPrompt</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;&lt;b&gt;&quot;</span><span class="ActionScriptOperator">+</span><span class="ActionScriptDefault_Text">_htmlPrompt</span><span class="ActionScriptOperator">+</span><span class="ActionScriptString">&quot;&lt;/b&gt;&quot;</span>;

            <span class="ActionScriptDefault_Text">_htmlPrompt</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;&lt;FONT COLOR=&apos;&quot;</span><span class="ActionScriptOperator">+</span><span class="ActionScriptDefault_Text">_promptColor</span><span class="ActionScriptOperator">+</span><span class="ActionScriptString">&quot;&apos;&gt;&quot;</span><span class="ActionScriptOperator">+</span><span class="ActionScriptDefault_Text">_htmlPrompt</span><span class="ActionScriptOperator">+</span><span class="ActionScriptString">&quot;&lt;/FONT&gt;&quot;</span>;

            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_required</span><span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptDefault_Text">_htmlPrompt</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">_htmlPrompt</span><span class="ActionScriptOperator">+</span><span class="ActionScriptString">&quot;&lt;FONT COLOR=&apos;&quot;</span><span class="ActionScriptOperator">+</span><span class="ActionScriptDefault_Text">_requiredColor</span><span class="ActionScriptOperator">+</span><span class="ActionScriptString">&quot;&apos;&gt; *&lt;/FONT&gt;&quot;</span>;
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_showPrompt</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">((!</span><span class="ActionScriptDefault_Text">clearPromptOnFocus</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">||</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">clearPromptOnFocus</span> <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptOperator">!</span><span class="ActionScriptDefault_Text">_hasFocus</span><span class="ActionScriptBracket/Brace">))</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">htmlText</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">_htmlPrompt</span>;
                <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">displayAsPassword</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptReserved">else</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">htmlText</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;&lt;FONT COLOR=&apos;&quot;</span><span class="ActionScriptOperator">+</span><span class="ActionScriptDefault_Text">getStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;color&quot;</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">+</span><span class="ActionScriptString">&quot;&apos;&gt;&lt;/FONT&gt;&quot;</span>;
            <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptReserved">else</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">setStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;color&quot;</span>, <span class="ActionScriptDefault_Text">getStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;color&quot;</span><span class="ActionScriptBracket/Brace">))</span>;
            <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">htmlText</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">_text</span>;
            <span class="ActionScriptDefault_Text">_showPrompt</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
            <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">displayAsPassword</span> <span class="ActionScriptOperator">!=</span> <span class="ActionScriptDefault_Text">_displayAsPassword</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">displayAsPassword</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">_displayAsPassword</span>;
            <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">commitProperties</span><span class="ActionScriptBracket/Brace">()</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">measure</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">measure</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptComment">// Reduces the original minimum height of the textArea from 2 to 1 line
</span>        <span class="ActionScriptDefault_Text">measuredMinHeight</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">measuredHeight</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">DEFAULT_MEASURED_MIN_HEIGHT</span>;
        <span class="ActionScriptDefault_Text">measuredWidth</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">DEFAULT_MEASURED_WIDTH</span>;

        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">lineMetrics</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">TextLineMetrics</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">measureText</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">text</span><span class="ActionScriptBracket/Brace">)</span>;

        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">measuredWidth</span> <span class="ActionScriptOperator">&lt;</span> <span class="ActionScriptDefault_Text">lineMetrics</span>.<span class="ActionScriptDefault_Text">width</span> <span class="ActionScriptOperator">+</span> 10 <span class="ActionScriptOperator">&amp;&amp;</span> <span class="ActionScriptDefault_Text">_variableWidth</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptDefault_Text">measuredWidth</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">measuredMinWidth</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">lineMetrics</span>.<span class="ActionScriptDefault_Text">width</span> <span class="ActionScriptOperator">+</span> 10;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">styleChanged</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">styleProp</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">styleChanged</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">styleProp</span><span class="ActionScriptBracket/Brace">)</span>;

        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">getStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;promptColor&quot;</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">!=</span> <span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">_promptColor</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">toHex</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">getStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;promptColor&quot;</span><span class="ActionScriptBracket/Brace">))</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">getStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;promptStyle&quot;</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">!=</span> <span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">_promptStyle</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">getStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;promptStyle&quot;</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">getStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;promptWeight&quot;</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">!=</span> <span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">_promptWeight</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">getStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;promptWeight&quot;</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">getStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;requiredColor&quot;</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">!=</span> <span class="ActionScriptReserved">null</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">_requiredColor</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">toHex</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">getStyle</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;requiredColor&quot;</span><span class="ActionScriptBracket/Brace">))</span>;
        <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//  Methods
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>
     <span class="ActionScriptASDoc">/**
     *  @private
     *  Converts an integer to it&apos;s hexadecimal value.
     *
     *  @param n the integer to convert.
     *
     *     @return for example #FFFFFF
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptReserved">static</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">toHex</span><span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptDefault_Text">n</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">s</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;&quot;</span>;

        <span class="ActionScriptReserved">for</span> <span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">i</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> 0; <span class="ActionScriptDefault_Text">i</span> <span class="ActionScriptOperator">&lt;</span> 4; <span class="ActionScriptDefault_Text">i</span><span class="ActionScriptOperator">++</span> <span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">s</span> <span class="ActionScriptOperator">+=</span> <span class="ActionScriptDefault_Text">hexChars</span>.<span class="ActionScriptDefault_Text">charAt</span><span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptDefault_Text">n</span> <span class="ActionScriptOperator">&gt;&gt;</span> <span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptBracket/Brace">(</span> 3 <span class="ActionScriptOperator">-</span> <span class="ActionScriptDefault_Text">i</span> <span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">*</span> 8 <span class="ActionScriptOperator">+</span> 4 <span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">&amp;</span> 0<span class="ActionScriptDefault_Text">xF</span> <span class="ActionScriptBracket/Brace">)</span>
                <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">hexChars</span>.<span class="ActionScriptDefault_Text">charAt</span><span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptDefault_Text">n</span> <span class="ActionScriptOperator">&gt;&gt;</span> <span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptBracket/Brace">(</span> 3 <span class="ActionScriptOperator">-</span> <span class="ActionScriptDefault_Text">i</span> <span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">*</span> 8 <span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">&amp;</span> 0<span class="ActionScriptDefault_Text">xF</span> <span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptDefault_Text">s</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;#&quot;</span><span class="ActionScriptOperator">+</span><span class="ActionScriptDefault_Text">s</span>.<span class="ActionScriptDefault_Text">substr</span><span class="ActionScriptBracket/Brace">(</span>2, 7<span class="ActionScriptBracket/Brace">)</span>;

        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">s</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//  Overridden event handlers: UIComponent
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  @private
     *     Intercepts the DELETE and RIGHT arrow keys
     *     to automatically reposition the cursor
     *     at the beginning  of the SuperTextInput control
     *     if no text was entered but the prompt text
     *     was activated.
     */</span>
    <span class="ActionScriptReserved">override</span> <span class="ActionScriptReserved">protected</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">keyDownHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">KeyboardEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">keyDownHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;

        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_showPrompt</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">keyCode</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">Keyboard</span>.<span class="ActionScriptDefault_Text">RIGHT</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">setSelection</span><span class="ActionScriptBracket/Brace">(</span>0,0<span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptDefault_Text">_delete</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
        <span class="ActionScriptReserved">if</span><span class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">keyCode</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptDefault_Text">Keyboard</span>.<span class="ActionScriptDefault_Text">DELETE</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">_delete</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//  Event handlers
</span>    <span class="ActionScriptComment">//
</span>    <span class="ActionScriptComment">//--------------------------------------------------------------------------
</span>
    <span class="ActionScriptASDoc">/**
     *  @private
     *     Automatically repositions the cursor at the beginning
     *     of the SuperTextInput control when the focus is set
     *     if no text was entered but the prompt text
     *     was activated.
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">handleFocusIn</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">FocusEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span> <span class="ActionScriptReserved">void</span> <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptDefault_Text">_hasFocus</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_showPrompt</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">setSelection</span><span class="ActionScriptBracket/Brace">(</span>0,0<span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     *     Reinstates the prompt when the SuperTextInput control
     *  loses the focus if the clearPromptOnFocus
     *     property is &lt;code&gt;true&lt;/code&gt;
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">handleFocusOut</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">FocusEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span> <span class="ActionScriptReserved">void</span> <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptDefault_Text">_hasFocus</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">clearPromptOnFocus</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">invalidateProperties</span><span class="ActionScriptBracket/Brace">()</span>;
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     *     Captures the user&apos;s input and handle whether
     *     or not to show the prompt text or the user&apos;s
     *     input.
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">handleTextChange</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span> <span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptDefault_Text">_showPrompt</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">tmpPrompt</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">_prompt</span>;

        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_delete</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptDefault_Text">tmpPrompt</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">_prompt</span>.<span class="ActionScriptDefault_Text">substr</span><span class="ActionScriptBracket/Brace">(</span>1, <span class="ActionScriptDefault_Text">_prompt</span>.<span class="ActionScriptDefault_Text">length</span><span class="ActionScriptBracket/Brace">)</span>;

        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">StringUtils</span>.<span class="ActionScriptDefault_Text">remove</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">text</span>, <span class="ActionScriptDefault_Text">tmpPrompt</span><span class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptString">&quot;&quot;</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">_showPrompt</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptDefault_Text">_text</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">text</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">StringUtils</span>.<span class="ActionScriptDefault_Text">remove</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">text</span>, <span class="ActionScriptDefault_Text">tmpPrompt</span><span class="ActionScriptOperator">+</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_required</span> <span class="ActionScriptOperator">?</span> <span class="ActionScriptString">&quot; *&quot;</span> <span class="ActionScriptOperator">:</span> <span class="ActionScriptString">&quot;&quot;</span><span class="ActionScriptBracket/Brace">))</span>;

        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_startUpperCase</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">_text</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">text</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">StringUtils</span>.<span class="ActionScriptDefault_Text">capitalize</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_text</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptBracket/Brace">}</span>

        <span class="ActionScriptDefault_Text">invalidateProperties</span><span class="ActionScriptBracket/Brace">()</span>;
    <span class="ActionScriptBracket/Brace">}</span>

    <span class="ActionScriptASDoc">/**
     *  @private
     */</span>
    <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">reposition</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">MouseEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
    <span class="ActionScriptBracket/Brace">{</span>
        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_showPrompt</span><span class="ActionScriptBracket/Brace">)</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">super</span>.<span class="ActionScriptDefault_Text">setSelection</span><span class="ActionScriptBracket/Brace">(</span>0,0<span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">}</span>

<span class="ActionScriptBracket/Brace">}</span>
<span class="ActionScriptBracket/Brace">}</span></pre></body>
</html>
